package com.kakarote.admin.service;

import com.alibaba.fastjson.JSONObject;
import com.kakarote.admin.entity.BO.AdminLanguagePackBO;
import com.kakarote.admin.entity.BO.AdminLanguagePackTypeBO;
import com.kakarote.admin.entity.PO.AdminLanguagePack;
import com.kakarote.admin.entity.VO.AdminLanguagePackVO;
import com.kakarote.common.log.entity.OperationLog;
import com.kakarote.core.entity.BasePage;
import com.kakarote.core.feign.admin.entity.AdminLanguagePackFieldBO;
import com.kakarote.core.servlet.BaseService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;


/**
 * <p>
 * 语言包表 服务类
 * </p>
 *
 * @author zmj
 * @since 2020-12-01
 */
public interface IAdminLanguagePackService extends BaseService<AdminLanguagePack> {

    /**
     * 查询语言包列表
     *
     * @param systemOrUser
     * @param adminLanguagePackBO
     * @return a
     */
    public BasePage<AdminLanguagePackVO> queryLanguagePackList(AdminLanguagePackBO adminLanguagePackBO, Integer systemOrUser);

    /**
     * 新增语言包列表
     *
     * @param file:文件
     * @param adminLanguagePackBO:adminUserBO
     * @return
     */
    public void addOrUpdateLanguagePack(MultipartFile file, AdminLanguagePackBO adminLanguagePackBO);

    /**
     * 删除语言包
     *
     * @param id:id
     * @return a
     */
    public OperationLog deleteLanguagePackById(Long id);

    /**
     * 导出语言包
     *
     * @param id       id
     * @param response response
     */
    public void exportLanguagePackById(Long id, HttpServletResponse response);

    /**
     * 删除语言包
     *
     * @param id id
     * @return
     */
    public String queryLanguagePackContextById(Long id);

    /**
     * 导出模板
     *
     * @param response response
     */
    public void downloadExcel(HttpServletResponse response);

    /**
     * 导出模板
     *
     * @param adminLanguagePackBO adminLanguagePackBO
     */
    public void updateLanguagePackNameById(AdminLanguagePackBO adminLanguagePackBO);

    /**
     * 修改默认语言包配置
     *
     * @param id           id
     * @param systemOrUser systemOrUser
     */
    public OperationLog setDeflautLanguagePackSetting(Long id, Integer systemOrUser);

    /**
     * 查询默认语言包配置
     *
     * @param systemOrUser
     * @return data
     */
    public JSONObject queryDeflautLanguagePackSetting(Integer systemOrUser, Integer type, Boolean needContext);

    /**
     * 查询默认语言包配置
     *
     * @return data
     */
    public JSONObject queryUserZhLanguage(Integer type, Boolean needContext);

    /**
     * 功能描述: <br>
     * 〈〉
     *
     * @Param: 批量增加多语言字段
     * @Return:
     * @Author: guole
     * @Date: 2021/11/18 19:09
     */
    public void batchAddUpdateLanguageKey(AdminLanguagePackFieldBO languageVOS);

    JSONObject queryTypeContext(AdminLanguagePackTypeBO adminLanguagePackTypeBO);

    JSONObject queryFilterContext();

    /**
     * 更具语言包名称查询
     */
    AdminLanguagePack queryByName(AdminLanguagePackBO adminLanguagePackBO);

    /**
     * 功能描述:
     * 〈根据ID查询语言包：跳过租户隔离〉
     * @param id id
     * @return 正常返回:{@link AdminLanguagePack}
     * @author zyh
     */
    AdminLanguagePack getLanduagePackById(Long id);
}
